﻿<UserControl x:Class="SilverlightApplication1.AdvancedSearch"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    Width="520" Height="210">
    <Canvas x:Name="cnvsRoot" Background="Transparent" Margin="0,28,0,0">
        <Border CornerRadius="2" Canvas.Left="6" Canvas.Top="26" Width="508" Height="183"
                Background="Transparent" Canvas.ZIndex="0"
                BorderBrush="SteelBlue" BorderThickness="0.5"/>
        <!--Background="CornflowerBlue"-->
        <Border CornerRadius="2" Canvas.Left="100" Canvas.Top="7" Width="414" Height="20"
                Background="Transparent" Canvas.ZIndex="0"
                BorderBrush="SteelBlue" BorderThickness="0.5"/>
        <!--Background="CornflowerBlue"-->
        <Border CornerRadius="2" Canvas.Left="10" Canvas.Top="30" Width="500" Height="175"
                Background="AliceBlue" Canvas.ZIndex="1"
                >
            <!--Background="AliceBlue"-->
        </Border>

        <!-- Title  -->
        <TextBlock x:Name="lblAdvTitle" Canvas.Left="106" Canvas.Top="10" Canvas.ZIndex="2"
                   Text="Advanced Search" FontSize="12"/>
        
        <!-- Filtered by -->
        <TextBlock x:Name="lblAdvFiltered" Canvas.Left="14" Canvas.Top="34" Canvas.ZIndex="2"
                   Text="Filtered by" FontSize="12"/>
            <!--  Author -->
            <TextBlock x:Name="lblFilAuthor" Canvas.Left="16" Canvas.Top="62" Canvas.ZIndex="2"
                   Text="Author:" FontSize="10"/>
            <TextBox x:Name="txtFilAuthor" Canvas.Left="70" Canvas.Top="58" Canvas.ZIndex="2"
                     Height="20" Width="80" MaxWidth="80" KeyDown="txtFilAuthor_KeyDown"
                     TextAlignment="Left" FontFamily="Verdana" FontSize="10"/>            
            <!--  Publisher -->
            <TextBlock x:Name="lblFilPublisher" Canvas.Left="16" Canvas.Top="92" Canvas.ZIndex="2"
                   Text="Publisher:" FontSize="10"/>
            <TextBox x:Name="txtFilPublisher" Canvas.Left="70" Canvas.Top="88" Canvas.ZIndex="2"
                     Height="20" Width="80" MaxWidth="80" KeyDown="txtFilPublisher_KeyDown"
                     TextAlignment="Left" FontFamily="Verdana" FontSize="10"/>
            <!--  Title -->
            <TextBlock x:Name="lblfilTitle" Canvas.Left="16" Canvas.Top="122" Canvas.ZIndex="2"
                   Text="Title:" FontSize="10"/>
            <TextBox x:Name="txtFilTitle" Canvas.Left="70" Canvas.Top="118" Canvas.ZIndex="2"
                     Height="20" Width="80" MaxWidth="80" KeyDown="txtFilTitle_KeyDown"
                     TextAlignment="Left" FontFamily="Verdana" FontSize="10"/>            
            <!-- Keyword -->
            <TextBlock x:Name="lblFilKeyword" Canvas.Left="160" Canvas.Top="62" Canvas.ZIndex="2"
                   Text="Keyword:" FontSize="10"/>
            <TextBox x:Name="txtFilKeyword" Canvas.Left="220" Canvas.Top="58" Canvas.ZIndex="2"
                     Height="20" Width="80" MaxWidth="80" KeyDown="txtFilKeyword_KeyDown"
                     TextAlignment="Left" FontFamily="Verdana" FontSize="10"/>
            <!-- Condition -->        
            <TextBlock x:Name="lblfilCondition" Canvas.Left="160" Canvas.Top="92" Canvas.ZIndex="2"
                   Text="Condition:" FontSize="10"/>
                <RadioButton x:Name="rbtnCndAll" Canvas.Left="220" Canvas.Top="90" Canvas.ZIndex="2"
                          Height="16" FontFamily="Verdana" FontSize="9" Content="All" GroupName="grpCond"
                             KeyDown="rbtnCnd_KeyDown"/>        
                <RadioButton x:Name="rbtnCndUsed" Canvas.Left="220" Canvas.Top="107" Canvas.ZIndex="2"
                          Height="16" FontFamily="Verdana" FontSize="9" Content="Used" GroupName="grpCond"
                             KeyDown="rbtnCnd_KeyDown"/>
                <RadioButton x:Name="rbtnCndCollectible" Canvas.Left="220" Canvas.Top="124" Canvas.ZIndex="2"
                          Height="16" FontFamily="Verdana" FontSize="9" Content="Collectible" GroupName="grpCond"
                             KeyDown="rbtnCnd_KeyDown"/>
                <RadioButton x:Name="rbtnCndRefurbished" Canvas.Left="220" Canvas.Top="141" Canvas.ZIndex="2"
                          Height="16" FontFamily="Verdana" FontSize="9" Content="Refurbished" GroupName="grpCond"
                             KeyDown="rbtnCnd_KeyDown"/>
                    
            <!--  Category --><!--Canvas.Left="320"-->
            <TextBlock x:Name="lblfilCategory" Canvas.Left="310" Canvas.Top="62" Canvas.ZIndex="2"
                   Text="Category:" FontSize="10"/>
            <!-- ComboBox--><!--Canvas.Left="378"-->
                <TextBox x:Name="txtFilCategory" Canvas.Left="362" Canvas.Top="58" Canvas.ZIndex="2"
                         Height="20" Width="140" MaxWidth="140"
                         TextAlignment="Left" FontFamily="Verdana" FontSize="10" IsReadOnly="True"
                         KeyDown="txtFilCategory_KeyDown" GotFocus="txtFilCategory_GotFocus"/>
                <Border Canvas.Left="487" Canvas.Top="60" Canvas.ZIndex="2"
                        Height="16" Width="14" Background="White"><!--Canvas.Left="500"-->
                    <Button x:Name="btnFilCategory" HorizontalAlignment="Center" VerticalAlignment="Center"
                           Height="40" Width="40" Background="Black" 
                           ClickMode="Press" Click="btnFilCategory_Click">
                        <Button.Content>
                            <Image Source="images/arrowDown.jpg" Stretch="None"
                                   HorizontalAlignment="Center" VerticalAlignment="Center"/>
                        </Button.Content>
                    </Button>
                </Border>
                                            
                <ListBox x:Name="lstItems" Canvas.Left="360" Canvas.Top="79" Canvas.ZIndex="3"
                         IsHitTestVisible="True" Visibility="Collapsed"
                         Width="140" Height="60" 
                         SelectionChanged="lstItems_SelectionChanged" LostFocus="lstSortBy_LostFocus">                    
                    <!-- Animation -->
                    <ListBox.Resources>
                        <Storyboard x:Name="toVisibleCategory" Storyboard.TargetName="lstItems"
                                    Completed="toVisibleCategory_Completed"
                                    SpeedRatio="4">
                            <DoubleAnimation Storyboard.TargetProperty="(ListBox.Height)" By="0" From="0" To="60"/>                    
                        </Storyboard>
                    </ListBox.Resources>
                    
                    <!-- Items: Category's-->
                    <!-- Literature and Fiction -->
                    <ListBoxItem KeyDown="item_KeyDown">
                        <ListBoxItem.Content>
                            <TextBlock x:Name="txtCatLF" Text="Literature and Fiction" Tag="17" FontSize="10" MaxWidth="130"
                                      MouseLeftButtonUp="item_MouseLeftButtonUp"/>
                        </ListBoxItem.Content>
                    </ListBoxItem>
                    <!-- Medicine -->
                    <ListBoxItem  KeyDown="item_KeyDown">
                        <ListBoxItem.Content>
                            <TextBlock x:Name="txtCatMedicine" Text="Medicine" Tag="13996" FontSize="10" MaxWidth="130"
                                       MouseLeftButtonUp="item_MouseLeftButtonUp"/>
                        </ListBoxItem.Content>
                    </ListBoxItem>
                    <!-- Mystery & Thrillers -->
                    <ListBoxItem KeyDown="item_KeyDown">
                        <ListBoxItem.Content>
                            <TextBlock x:Name="txtCatMT" Text="Mystery and Thrillers" Tag="18" FontSize="10" MaxWidth="130"
                                       MouseLeftButtonUp="item_MouseLeftButtonUp"/>
                        </ListBoxItem.Content>
                    </ListBoxItem>
                    <!-- Nonfiction -->
                    <ListBoxItem KeyDown="item_KeyDown">
                        <ListBoxItem.Content>
                            <TextBlock x:Name="txtCatNonfiction" Text="Nonfiction" Tag="53" FontSize="10" MaxWidth="130"                                       
                                       MouseLeftButtonUp="item_MouseLeftButtonUp"/>
                        </ListBoxItem.Content>
                    </ListBoxItem>
                    <!-- Outdoors & Nature -->
                    <ListBoxItem KeyDown="item_KeyDown">
                        <ListBoxItem.Content>
                            <TextBlock x:Name="txtCatON" Text="Outdoors and Nature" Tag="290060" FontSize="10" MaxWidth="130"                                       
                                       MouseLeftButtonUp="item_MouseLeftButtonUp"/>
                        </ListBoxItem.Content>
                    </ListBoxItem>                    
                </ListBox>
            
            <!-- Max Price -->
            <TextBlock x:Name="lblFilMaxPrice" Canvas.Left="310" Canvas.Top="92" Canvas.ZIndex="2"
                   Text="Maximum Price:" FontSize="10"/>
            <TextBox x:Name="txtFilMaxPrice" Canvas.Left="395" Canvas.Top="88" Canvas.ZIndex="2"
                     Height="20" Width="80" MaxWidth="80" KeyDown="txtFilMaxPrice_KeyDown"
                     TextAlignment="Left" FontFamily="Verdana" FontSize="10"/>
            <!-- Min Price -->
            <TextBlock x:Name="lblFilMinPrice" Canvas.Left="310" Canvas.Top="122" Canvas.ZIndex="2"
                   Text="Minimum Price:" FontSize="10"/>
            <TextBox x:Name="txtFilMinPrice" Canvas.Left="395" Canvas.Top="118" Canvas.ZIndex="2"
                     Height="20" Width="80" MaxWidth="80" KeyDown="txtFilMinPrice_KeyDown"
                     TextAlignment="Left" FontFamily="Verdana" FontSize="10"/>
        <!-- Sort by -->
        <TextBlock x:Name="lblAdvSort" Canvas.Left="14" Canvas.Top="145" Canvas.ZIndex="2"        
                   Text="Sort by" FontSize="12"/>
        
        <!-- First by -->
        <TextBlock x:Name="lblSortFirst" Canvas.Left="16" Canvas.Top="166" Canvas.ZIndex="2"
                   Text="First by:" FontSize="10"/>
            <!-- ComboBox --><!--Canvas.Left="64" y 128 el Border-->
            <TextBox x:Name="txtSortFirst" Canvas.Left="70" Canvas.Top="162" Canvas.ZIndex="2"
                             Height="20" Width="80" MaxWidth="80" Tag="0"
                             TextAlignment="Left" FontFamily="Verdana" FontSize="9" IsReadOnly="True"
                             KeyDown="txtSortBy_KeyDown" GotFocus="txtSortBy_GotFocus" TextChanged="txtSortByF_TextChanged"/>                     
            <Border Canvas.Left="135" Canvas.Top="164" Canvas.ZIndex="2"
                Height="16" Width="14" Background="White">
                <Button x:Name="btnSortFirst" Height="40" Width="40" Background="Black" HorizontalAlignment="Center" VerticalAlignment="Center"
                       ClickMode="Press" Click="btnSortBy_Click">
                    <Button.Content>
                            <Image Source="images/arrowDown.jpg" Stretch="None"
                                   HorizontalAlignment="Center" VerticalAlignment="Center"/>
                    </Button.Content>                
                </Button>
            </Border>
                                    
            <ListBox x:Name="lstSortFirst" Canvas.Left="70" Canvas.Top="180" Canvas.ZIndex="3"
                     IsHitTestVisible="True" Visibility="Collapsed"
                     Width="80" Height="30" ScrollViewer.HorizontalScrollBarVisibility="Hidden" 
                     SelectionChanged="lstSortBy_SelectionChanged" LostFocus="lstSortBy_LostFocus">                    
                <!-- Animation -->
                <ListBox.Resources>
                    <Storyboard x:Name="toVisibleSortFirst" Storyboard.TargetName="lstSortFirst"
                                        SpeedRatio="4"
                                Completed="toVisibleSortByF_Completed">
                        <DoubleAnimation Storyboard.TargetProperty="(ListBox.Height)" By="0" From="0" To="40"/>                    
                    </Storyboard>
                </ListBox.Resources>
                                                               
                <!-- List Price -->
                <ListBoxItem KeyDown="itemSortByF_KeyDown">
                    <ListBoxItem.Content>
                        <TextBlock x:Name="txtFLPrice" Text="List Price" FontSize="9"
                                   MouseLeftButtonUp="itemSortByF_MouseLeftButtonUp"/>
                    </ListBoxItem.Content>
                </ListBoxItem>
                <!-- Publication -->
                <ListBoxItem KeyDown="itemSortByF_KeyDown">
                    <ListBoxItem.Content>
                        <TextBlock x:Name="txtFPublication" Text="Publication" FontSize="9"
                                   MouseLeftButtonUp="itemSortByF_MouseLeftButtonUp"/>
                    </ListBoxItem.Content>
                </ListBoxItem>     
                <!-- Title -->
                <ListBoxItem KeyDown="itemSortByF_KeyDown">
                    <ListBoxItem.Content>
                        <TextBlock x:Name="txtFTitle" Text="Title" FontSize="9"
                                   MouseLeftButtonUp="itemSortByF_MouseLeftButtonUp"/>
                    </ListBoxItem.Content>
                </ListBoxItem>                    
            </ListBox>
        <!-- Second by --><!--Canvas.Left="156"-->
        <TextBlock x:Name="lblSortSecond" Canvas.Left="160" Canvas.Top="166" Canvas.ZIndex="2"
                   Text="Second by:" FontSize="10"/>
            <!-- ComboBox --><!--Canvas.Left="215"-->
            <TextBox x:Name="txtSortSecond" Canvas.Left="220" Canvas.Top="162" Canvas.ZIndex="2"
                             Height="20" Width="80" MaxWidth="80" Tag="0"
                             TextAlignment="Left" FontFamily="Verdana" FontSize="9" IsReadOnly="True"
                             KeyDown="txtSortBy_KeyDown" GotFocus="txtSortBy_GotFocus" TextChanged="txtSortByS_TextChanged"/>
            <Border Canvas.Left="285" Canvas.Top="164" Canvas.ZIndex="2"
                Height="16" Width="14" Background="White"><!--Canvas.Left="278"-->
                <Button x:Name="btnSortSecond" Height="40" Width="40" Background="Black" HorizontalAlignment="Center" VerticalAlignment="Center"
                       ClickMode="Press" Click="btnSortBy_Click">                    
                    <Button.Content>
                            <Image Source="images/arrowDown.jpg" Stretch="None"
                                   HorizontalAlignment="Center" VerticalAlignment="Center"/>
                    </Button.Content>                
                </Button>
            </Border>                    
                                
            <ListBox x:Name="lstSortSecond" Canvas.Left="220" Canvas.Top="180" Canvas.ZIndex="3"
                     IsHitTestVisible="True" Visibility="Collapsed" 
                     Width="80" Height="30" ScrollViewer.HorizontalScrollBarVisibility="Hidden" 
                     SelectionChanged="lstSortBy_SelectionChanged" LostFocus="lstSortBy_LostFocus">                    
                <!-- Animation -->
                <ListBox.Resources>
                    <Storyboard x:Name="toVisibleSortSecond" Storyboard.TargetName="lstSortSecond"
                                        SpeedRatio="4"
                                Completed="toVisibleSortByS_Completed">
                        <DoubleAnimation Storyboard.TargetProperty="(ListBox.Height)" By="0" From="0" To="40"/>                    
                    </Storyboard>
                </ListBox.Resources>
                                                               
                <!-- List Price -->
                <ListBoxItem KeyDown="itemSortByS_KeyDown">
                    <ListBoxItem.Content>
                        <TextBlock x:Name="txtSLPrice" Text="List Price" FontSize="9"
                                   MouseLeftButtonUp="itemSortByS_MouseLeftButtonUp"/>
                    </ListBoxItem.Content>
                </ListBoxItem>
                <!-- Publication -->
                <ListBoxItem KeyDown="itemSortByS_KeyDown">
                    <ListBoxItem.Content>
                        <TextBlock x:Name="txtSPublication" Text="Publication" FontSize="9"
                                   MouseLeftButtonUp="itemSortByS_MouseLeftButtonUp"/>
                    </ListBoxItem.Content>
                </ListBoxItem>     
                <!-- Title -->
                <ListBoxItem KeyDown="itemSortByS_KeyDown">
                    <ListBoxItem.Content>
                        <TextBlock x:Name="txtSTitle" Text="Title" FontSize="9"
                                   MouseLeftButtonUp="itemSortByS_MouseLeftButtonUp"/>
                    </ListBoxItem.Content>
                </ListBoxItem>                                        
            </ListBox>
        <!-- Third by -->
        <TextBlock x:Name="lblSortThird" Canvas.Left="310" Canvas.Top="166" Canvas.ZIndex="2"
                   Text="Third by:" FontSize="10"/>
            <!-- ComboBox -->
            <TextBox x:Name="txtSortThird" Canvas.Left="362" Canvas.Top="162" Canvas.ZIndex="2"
                             Height="20" Width="80" MaxWidth="80" Tag="0"
                             TextAlignment="Left" FontFamily="Verdana" FontSize="9" IsReadOnly="True"
                             GotFocus="txtSortBy_GotFocus" KeyDown="txtSortBy_KeyDown" TextChanged="txtSortByT_TextChanged"/>
            <Border Canvas.Left="427" Canvas.Top="164" Canvas.ZIndex="2"
                Height="16" Width="14" Background="White">
                <Button x:Name="btnSortThird" Height="40" Width="40" Background="Black" HorizontalAlignment="Center" VerticalAlignment="Center"
                       ClickMode="Press" Click="btnSortBy_Click">
                    <Button.Content>
                            <Image Source="images/arrowDown.jpg" Stretch="None"
                                   HorizontalAlignment="Center" VerticalAlignment="Center"/>
                    </Button.Content>                
                </Button>
            </Border>                    
            <ListBox x:Name="lstSortThird" Canvas.Left="362" Canvas.Top="180" Canvas.ZIndex="3"
                     IsHitTestVisible="True" Visibility="Collapsed" 
                     Width="80" Height="30" ScrollViewer.HorizontalScrollBarVisibility="Hidden" 
                     SelectionChanged="lstSortBy_SelectionChanged" LostFocus="lstSortBy_LostFocus">                    
                <!-- Animation -->
                <ListBox.Resources>
                    <Storyboard x:Name="toVisibleSortThird" Storyboard.TargetName="lstSortThird"
                                        SpeedRatio="4"
                                Completed="toVisibleSortByT_Completed">
                        <DoubleAnimation Storyboard.TargetProperty="(ListBox.Height)" By="0" From="0" To="40"/>                    
                    </Storyboard>
                </ListBox.Resources>
                                                               
                <!-- List Price -->
                <ListBoxItem KeyDown="itemSortByT_KeyDown">
                    <ListBoxItem.Content>
                        <TextBlock x:Name="txtTLPrice" Text="List Price" FontSize="9"
                                   MouseLeftButtonUp="itemSortByT_MouseLeftButtonUp"/>
                    </ListBoxItem.Content>
                </ListBoxItem>
                <!-- Publication -->
                <ListBoxItem KeyDown="itemSortByT_KeyDown">
                    <ListBoxItem.Content>
                        <TextBlock x:Name="txtTPublication" Text="Publication" FontSize="9"
                                   MouseLeftButtonUp="itemSortByT_MouseLeftButtonUp"/>
                    </ListBoxItem.Content>
                </ListBoxItem>     
                <!-- Title -->
                <ListBoxItem KeyDown="itemSortByT_KeyDown">
                    <ListBoxItem.Content>
                        <TextBlock x:Name="txtTTitle" Text="Title" FontSize="9"
                                   MouseLeftButtonUp="itemSortByT_MouseLeftButtonUp"/>
                    </ListBoxItem.Content>
                </ListBoxItem>                    
            </ListBox>
        
        <!-- Sort Price by Ascending or Descending -->        
        <RadioButton x:Name="rbtnPOrderFAsc" Canvas.Left="70" Canvas.Top="185" Canvas.ZIndex="2"
                      Height="16" FontFamily="Verdana" FontSize="9" Content="Asc" Visibility="Collapsed" GroupName="grpPOrderF"
                     Checked="rbtnPOrderAsc_Checked"/>
        <RadioButton x:Name="rbtnPOrderFDesc" Canvas.Left="112" Canvas.Top="185" Canvas.ZIndex="2"
                     Height="16" FontFamily="Verdana" FontSize="9" Content="Desc" Visibility="Collapsed" GroupName="grpPOrderF"
                     Checked="rbtnPOrderDesc_Checked"/>
        <RadioButton x:Name="rbtnPOrderSAsc" Canvas.Left="220" Canvas.Top="185" Canvas.ZIndex="2"
                          Height="16" FontFamily="Verdana" FontSize="9" Content="Asc" Visibility="Collapsed" GroupName="grpPOrderS"
                     Checked="rbtnPOrderAsc_Checked"/>
        <RadioButton x:Name="rbtnPOrderSDesc" Canvas.Left="262" Canvas.Top="185" Canvas.ZIndex="2"
                         Height="16" FontFamily="Verdana" FontSize="9" Content="Desc" Visibility="Collapsed" GroupName="grpPOrderS"
                     Checked="rbtnPOrderDesc_Checked"/>
        <RadioButton x:Name="rbtnPOrderTAsc" Canvas.Left="362" Canvas.Top="185" Canvas.ZIndex="2"
                          Height="16" FontFamily="Verdana" FontSize="9" Content="Asc" Visibility="Collapsed" GroupName="grpPOrderT"
                     Checked="rbtnPOrderAsc_Checked"/>
        <RadioButton x:Name="rbtnPOrderTDesc" Canvas.Left="404" Canvas.Top="185" Canvas.ZIndex="2"
                         Height="16" FontFamily="Verdana" FontSize="9" Content="Desc" Visibility="Collapsed" GroupName="grpPOrderT"
                     Checked="rbtnPOrderDesc_Checked"/>
        
        <RadioButton x:Name="rbtnPOrderAsc" Canvas.Left="450" Canvas.Top="160" Canvas.ZIndex="2"
                          Height="16" FontFamily="Verdana" FontSize="9" Content="Asc" Visibility="Collapsed" GroupName="grpPOrder"/>
        <RadioButton x:Name="rbtnPOrderDesc" Canvas.Left="450" Canvas.Top="180" Canvas.ZIndex="2"
                         Height="16" FontFamily="Verdana" FontSize="9" Content="Desc" Visibility="Collapsed" GroupName="grpPOrder"/>
            
        <!-- hlk clean fields -->
        <HyperlinkButton x:Name="hlkClean" Canvas.Left="472" Canvas.Top="192" Canvas.ZIndex="2"
                         FontSize="10" FontFamily="Verdana" Foreground="SteelBlue"                         
                         Content="clean" Click="hlkClean_Click"/>
                         
                
    </Canvas>
</UserControl>
